package sectorCrack.bean;

import java.io.Serializable;
import java.math.RoundingMode;
import java.text.DecimalFormat;

public class Dat implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int timestamp;
	private float elevationMax;
	private float elevationMin;
	private float azimuthMax;
	private float azimuthMin;
	private float slantRangeMax;
	private float slantRangeMin;
	private float velocityRaw;
	private float velocitySpikeFiltered;
	private float snr;
	private int cfar;
	private int mcfar;
	private int qbit;

	public String toString() {
		StringBuffer sb = new StringBuffer();
		DecimalFormat df = new DecimalFormat("#.##");
		df.setRoundingMode(RoundingMode.HALF_UP);
		String date = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date((long) (timestamp - 8 * 60 * 60) * 1000L));
		sb.append(date);
		sb.append(" el ");
		sb.append(df.format(elevationMin) + " " + df.format(elevationMax));
		sb.append(" az ");
		sb.append(df.format(azimuthMin) + " " + df.format(azimuthMax));
		sb.append(" slant ");
		sb.append(df.format(slantRangeMin) + " " + df.format(slantRangeMax));
		sb.append(" vel ");
		if (Float.isNaN(velocityRaw)) {
			sb.append("-999 ");
		} else {
			sb.append(df.format(velocityRaw) + " ");
		}
		if (Float.isNaN(velocitySpikeFiltered)) {
			sb.append("-999");
		} else {
			sb.append(df.format(velocitySpikeFiltered));
		}
		sb.append(" snr ");
		sb.append(df.format(snr));
		sb.append(" car ");
		sb.append(df.format(cfar));
		sb.append(" mcfar ");
		sb.append(df.format(mcfar));
		sb.append(" qbit ");
		sb.append(df.format(qbit));
		return sb.toString();
	}

	public int getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(int timestamp) {
		this.timestamp = timestamp;
	}

	public float getElevationMax() {
		return elevationMax;
	}

	public void setElevationMax(float elevationMax) {
		this.elevationMax = elevationMax;
	}

	public float getElevationMin() {
		return elevationMin;
	}

	public void setElevationMin(float elevationMin) {
		this.elevationMin = elevationMin;
	}

	public float getAzimuthMax() {
		return azimuthMax;
	}

	public void setAzimuthMax(float azimuthMax) {
		this.azimuthMax = azimuthMax;
	}

	public float getAzimuthMin() {
		return azimuthMin;
	}

	public void setAzimuthMin(float azimuthMin) {
		this.azimuthMin = azimuthMin;
	}

	public float getSlantRangeMax() {
		return slantRangeMax;
	}

	public void setSlantRangeMax(float slantRangeMax) {
		this.slantRangeMax = slantRangeMax;
	}

	public float getSlantRangeMin() {
		return slantRangeMin;
	}

	public void setSlantRangeMin(float slantRangeMin) {
		this.slantRangeMin = slantRangeMin;
	}

	public float getVelocityRaw() {
		return velocityRaw;
	}

	public void setVelocityRaw(float velocityRaw) {
		this.velocityRaw = velocityRaw;
	}

	public float getVelocitySpikeFiltered() {
		return velocitySpikeFiltered;
	}

	public void setVelocitySpikeFiltered(float velocitySpikeFiltered) {
		this.velocitySpikeFiltered = velocitySpikeFiltered;
	}

	public float getSnr() {
		return snr;
	}

	public void setSnr(float snr) {
		this.snr = snr;
	}

	public int getCfar() {
		return cfar;
	}

	public void setCfar(int cfar) {
		this.cfar = cfar;
	}

	public int getMcfar() {
		return mcfar;
	}

	public void setMcfar(int mcfar) {
		this.mcfar = mcfar;
	}

	public int getQbit() {
		return qbit;
	}

	public void setQbit(int qbit) {
		this.qbit = qbit;
	}

}
